public class ServerThread extends Thread{
	Player m;
	GameServer server;
	
	public ServerThread(Player m, GameServer server){
		this.m=m;
		this.server=server;
		}
	
	 public void run() {
        String line;
            for(;;) {
                line = m.conn.receiveMsg();
                System.out.println(line);
				processMsg(line);
                if (line == null) break;
             }
    }
    private void processMsg(String str){
    	String cmd=Connection.getValue("cmd",str);
    	if (Connection.getCmd(str)==Connection.CMD_USERINFO){
    		m.setName(Connection.getValue("name",str));
    		m.setScore(Connection.getValue("score",str));
    	}
    	else server.processMsg(str);	
    	}
}